package com.kaifamiao.date1109;

public class Lion {
	
	protected String name ;
	protected int age ;
	
	// Instance Initializer,实例初始化器(实例初始化块)
	{
		System.out.println( "name 默认值: " + this.name );
		this.name = "狮子" ;
		System.out.println( "name 初始值: " + this.name );
	}
	
	// 同一个类中存在多个实例初始化块时，按照源代码中的顺序依次执行
	{
		System.out.println( "age 默认值: " + this.age );
		this.age = 0 ;
		System.out.println( "age 初始值: " + this.age );
	}
	
	public Lion(String name, int age) {
		super();
		System.out.println( "初始值: " + this.name + " , " + this.age );
		this.name = name;
		this.age = age;
		System.out.println( "name: " + this.name + " , age:" + this.age );
	}
	
}
